﻿<%@ Page Title="Compra" Language="C#" MasterPageFile="~/SiteCadastro.master" AutoEventWireup="true" CodeBehind="CompraView.aspx.cs" Inherits="ASPLanchonete.Telas.CompraView" %>
<asp:Content ID="Content1" ContentPlaceHolderID="form" runat="server">
    <h1>Pedido</h1>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
    <br />
    <p>
        <asp:Label Text="Código:" runat="server" Width="300"/>
        <asp:TextBox ID="txtCodigo" runat="server" Width="300"  CssClass="textBox" 
            Enabled="False">0</asp:TextBox>
    </p>
    <asp:UpdatePanel ID="udpFornecedor" runat="server">
        <ContentTemplate>
            <asp:Label Text="Fornecedor:" runat="server" Width="300"/>
            <asp:DropDownList ID="ddlListaFornecedor" runat="server" Width="300" 
                onselectedindexchanged="ddlListaFornecedor_SelectedIndexChanged" AutoPostBack="True"/>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <div style="float:right; width: 400px;height:240px; margin-right:10px;" >
        <asp:UpdatePanel ID="udpItemSelecionado" runat="server">
            <ContentTemplate>
                <asp:Label Text="Produto:" runat="server" Width="150"/>
                <asp:Label ID="lblProduto" runat="server" Width="150px" BorderStyle="Dotted" 
                    BorderWidth="1px" />
                <br />
                <br />
                <asp:Label Text="Qtde Prevista:" runat="server" Width="150"/>
                <asp:Label ID="lblQtdePrevista" runat="server" Width="150px" 
                    BorderStyle="Dotted" BorderWidth="1px" />
                <br />
                <br />
                <asp:Label Text="Data Entrega Prevista:" runat="server" Width="150"/>
                <asp:Label ID="lblDataEntregaPrevista" runat="server" Width="150px" 
                    BorderStyle="Dotted" BorderWidth="1px" />
                <br />
                <br />
                <asp:Label Text="Qtde Efetiva:" runat="server" Width="150"/>                    
                <asp:TextBox ID="txtQtdeEfetiva" runat="server" Width="150"  CssClass="textBox" />
                <br />
                <br />
                <asp:Label Text="Valor Unitário:" runat="server" Width="150"/>                    
                <asp:TextBox ID="txtValorUnitario" runat="server" Width="150"  CssClass="textBox" />
                <br />
                <br />
                <p align="right" >
                    <asp:Button ID="btnAdicionar" runat="server" Text="Adicionar" 
                        onclick="btnAdicionar_Click" />
                </p>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div style="min-height:400px;">
        <asp:UpdatePanel ID="udpProdutosPendentes" runat="server">
            <ContentTemplate>
                <asp:DataList ID="dtlProdutosPendentes" runat="server" 
                    onitemcommand="dtlProdutosPendentes_ItemCommand" >
                    <HeaderTemplate>
                        <table cellpadding="0" border="1" align="center">
                            <tr>
                                <th>Produto</th>
                                <th>Qtde Prevista</th>
                                <th>Data Entrega Prevista</th>
                                <th>Selecionado</th>
                                <th>Selecionar</th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                            <tr>
                                <td><%# Eval("Produto.NomeProduto")%></td>
                                <td><%# Eval("Qtde").ToString() %></td>
                                <td><%# Eval("DataPrevista", "{0:d}")%></td>
                                <td>
                                    <asp:CheckBox Checked='<%# Eval("Entregue") %>' Enabled="false" runat="server" />
                                </td>
                                <td align="center">
                                    <asp:ImageButton ID="btnAdicionar" runat="server" ImageUrl="~/Imagens/aplicar.gif" 
                                        AlternateText="Aplicar" CausesValidation="False" Height="30" Width="30" 
                                        CommandName="Selecionar" CommandArgument='<%# Eval("Id") %>' />
                                </td>
                            </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:DataList>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div style="height:40px; margin-top:10px;" >
        <asp:UpdatePanel ID="udpValorTotalCompra" runat="server">
            <ContentTemplate>
                <p>
                    <asp:Label Text="Valor Total da Compra" runat="server" Width="266" Font-Size="18px" Height="35px"/>
                    <asp:Label Text="R$" runat="server" Width="30px" Font-Size="25px" Height="35px"/>
                    <asp:TextBox ID="txtValorTotal" runat="server" Width="300" CssClass="textBox" Font-Size="25px" ForeColor="Red" Enabled="False" />
                </p>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="grid" runat="server">
</asp:Content>
